/**
 * 过滤菜单数据
 * menuList 接口返回菜单数组
 */
 export const setFormatteMenu = menuList => {
	let routeMenuList = [] //路由菜单
	// 遍历接口返回菜单数组
	menuList.forEach(menuItem => {
		let children
		// 是否有子菜单，如果有递归遍历
		if (menuItem.children && menuItem.children instanceof Array && menuItem.children.length > 0) {
			children = setFormatteMenu(menuItem.children)
		}
		let { id, label, iconCls, path, meta } = menuItem
		// 构造路由对象,添加到路由菜单数组
		let menuRoute = {
			// id,
			// label,
			path,
			meta:{
				title:meta.title,
				icon:iconCls
			},
			children,
			component:()=>{
				switch (path) {
					case '/main':
						return import('@/Layout')
					default:
						return import('@/views/platefrom' + path)
				}
			}
		}

		routeMenuList.push(menuRoute)
	
	})
	return routeMenuList
}